Repository navigation
feat: add Aria extension wallet (Cosmos, EVM, Solana) - #56
Open
dblackstone1 wants to merge 4 commits into
Open
dblackstone1 wants to merge 4 commits into
dblackstone1 wants to merge 4 commits into
Conversation
Add @interchain-kit/aria-extension so dApps can connect to the Aria extension: window.aria (Keplr-compatible) for Cosmos chains and window.aria.ethereum for EVM chains. Aria's enable connects the site without checking the chain, so a chain outside Aria's list only fails at getKey with "Unknown chain". The Cosmos wallet asks for the key on connect and suggests the chain then, as an enable failure does for Keplr.
Aria injects a Phantom-style Solana provider at window.aria.solana. The adapter registered only Cosmos and EVM, so a Solana chain failed with: Unsupported chain type: "solana".
SolanaWallet's sign methods name no chain, so Aria simulated and sent every Solana request on mainnet. Connect now calls Aria's changeCluster with the chain's cluster: the one its RPC names (as Solana's wallet adapter reads an endpoint), else its genesis-hash chain ID, else mainnet.
The example's devnet chain had testnet's genesis-hash chain ID and its testnet chain had devnet's. Solana's CAIP-2 IDs are the first 32 characters of each cluster's genesis hash: devnet EtWTRABZaYq6iMfeYKouRu166VU2xqa1, testnet 4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
@interchain-kit/aria-extension, an adapter for the Aria browser wallet.Aria injects:
window.aria: a Keplr-compatible Cosmos providerwindow.aria.ethereum: an EIP-1193 providerwindow.aria.solana: a Phantom-style Solana providerThe adapter registers Cosmos, EVM and Solana wallets for it, following the existing extension wallets.
One difference from Keplr: Aria's
enableconnects the site without checking the chain, so a chain Aria doesn't know only fails later atgetKeywith "Unknown chain".AriaCosmosWallet.connectasks for the key on connect and suggests the chain then, as anenablefailure does for Keplr.On Solana,
SolanaWallet's sign methods name no chain, soAriaSolanaWallet.connectsets the chain's cluster in Aria (changeCluster). One Aria Solana wallet serves every Solana chain, so with several configured, requests go to the cluster of the chain connected last.Also fixes
examples/react's Solana chain IDs: its devnet chain had testnet's genesis hash and its testnet chain had devnet's. They now match the CAIP-2 Solana namespace (devnetEtWTRABZaYq6iMfeYKouRu166VU2xqa1, testnet4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z).Testing
wallets/aria-extension/__tests__; lint and typecheck pass.examples/reactwith Aria (Playwright, unfunded wallet): cosmoshub-4, juno-1, osmosis-1, Sepolia and Solana devnet all connect through one approval. The Osmosis and Solana sends open the right approval, which was then rejected.🤖 Generated with Claude Code